<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of WebserviceFileManager
 *
 * @author bonfiglio
 */
class WebserviceFileManager extends WebserviceBase {

    public function answer() {
        //Log::pr($this,'Super');
//        $s = explode('file://', $this->post['path']);
//        $realPath =  'file://' . realpath($s[1]);
//        $file = file_get_contents($realPath);
        set_time_limit (60);
        //Log::pr($this->post['path']);
        $file = fopen($this->post['path'], 'r');
        //$file = new SplFileObject($this->post['path']);//'\\\\192.168.25.201\\EspaceCommun\\Accueil\\Trombinoscope 05 09 2012.docx'
//        Log::pr($s, 'Path : '.$realPath);
//        Log::pr(realpath($this->post['path']), 'RealPath : '.$realPath);
//        log::pr(pathinfo($realPath),'pathinfo');
//        Log::pre(filesize($realPath),'taille');
        if (!$file) {
            log::pr('Arf');
        } else {
            Log::pre($file);
            fpassthru($file);
            exit;
//            Log::pr($fpassthru,'fpassthru =>'.filesize($realPath));
        }
    }

}

?>
